import { post, get } from '../../../request.js'

/**
 * 查询所有元素
 * @param {*} params
 * @returns
 */
export const redisManagerTree = params => {
    return get({
        url: '/tool/redis/manager/getAllElement',
        params,
        loading: true
    })
}

/**
 * 详情查看
 * @param {*} params
 * @returns
 */
export const redisManagerInfo = params => {
    return get({
        url: '/tool/redis/manager/getInfoByKey',
        params,
        loading: true
    })
}

/**
 * 保存值
 * @param {*} params
 * @returns
 */
export const redisManagerSave = params => {
    return post({
        url: '/tool/redis/manager/save',
        params,
        loading: true
    })
}

/**
 * 重命名
 * @param {*} params
 * @returns
 */
export const redisManagerReName = params => {
    return get({
        url: '/tool/redis/manager/reName',
        params,
        loading: true
    })
}

/**
 * 删除元素
 * @param {*} params
 * @returns
 */
export const redisManagerDel = params => {
    return get({
        url: '/tool/redis/manager/del',
        params,
        loading: true
    })
}

/**
 * 设置过期时间
 * @param {*} params
 * @returns
 */
export const redisManagerSetTtl = params => {
    return post({
        url: '/tool/redis/manager/setTtl',
        params,
        loading: true
    })
}
